package com.suyafei.service;


import com.suyafei.model.ProductDO;
import com.suyafei.model.ProductMessage;
import com.suyafei.request.LockProductRequest;
import com.suyafei.vo.ProductVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author suyafei
 * @since 2021-03-08
 */
public interface ProductService  {
    /**
     * 分页查询商品
     * @param page
     * @param size
     * @return
     */
    Map<String, Object> page(int page, int size);

    /**
     * 根据id查找商品
     * @param productId
     * @return
     */
    ProductVO findDetailById(long productId);

    /**
     * 根据Id批量查询商品
     * @param productIdList
     * @return
     */
    List<ProductVO> findProductByIdBatch(List<Long> productIdList);

    /**
     * 锁定商品库存
     * @param lockProductRequest
     */
    void lockProductStock(LockProductRequest lockProductRequest);

    /**
     * 释放库存
     * @param productMessage
     * @return
     */
    boolean releaseProductStock(ProductMessage productMessage);
}
